using System.Data;
using ET;
namespace DA
{
	public class Bank_DAL
	{
	private clsConnect cls = new clsConnect();

	#region Getdata
	public DataTable BindGirdBank(string keywords)
	{
	return cls.Search("sp_tb_Bank_Search", "@KeyWords", keywords);
	}
    //public DataTable BindGirdBankDetail(int id)
    //{
    //}
	#endregion

	#region Insert
	public bool InsertBank(Bank_ET data)
	{
	cls.CreateNewSqlCommand();
	cls.AddParameter("@Bank_Alias", data.Bank_Alias);
	cls.AddParameter("@Bank_Name", data.Bank_Name);
	cls.AddParameter("@Bank_Note", data.Bank_Note);
	cls.AddParameter("@Bank_User_Add", data.Bank_User_Add);
	cls.AddParameter("@Bank_Date_Add", data.Bank_Date_Add);
	cls.AddParameter("@Bank_Computer_Add", data.Bank_Computer_Add);
	cls.AddParameter("@Bank_User_Modify", data.Bank_User_Modify);
	cls.AddParameter("@Bank_Date_Modify", data.Bank_Date_Modify);
	cls.AddParameter("@Bank_Computer_Modify", data.Bank_Computer_Modify);
    cls.ExecuteNonQuery("sp_tb_Bank_Insert");
	return true;
	}
	#endregion

	#region Update
	public bool UpdateBank(Bank_ET data)
	{
	cls.CreateNewSqlCommand();
	cls.AddParameter("@Bank_Id", data.Bank_Id);
	cls.AddParameter("@Bank_Alias", data.Bank_Alias);
	cls.AddParameter("@Bank_Name", data.Bank_Name);
	cls.AddParameter("@Bank_Note", data.Bank_Note);
	cls.AddParameter("@Bank_User_Add", data.Bank_User_Add);
	cls.AddParameter("@Bank_Date_Add", data.Bank_Date_Add);
	cls.AddParameter("@Bank_Computer_Add", data.Bank_Computer_Add);
	cls.AddParameter("@Bank_User_Modify", data.Bank_User_Modify);
	cls.AddParameter("@Bank_Date_Modify", data.Bank_Date_Modify);
	cls.AddParameter("@Bank_Computer_Modify", data.Bank_Computer_Modify);
    cls.ExecuteNonQuery("sp_tb_Bank_Update");
	return true;
	}
	#endregion

	#region Delete
	public bool DeleteBank(int id)
	{
        cls.Delete("sp_tb_Bank_Update", "@Bank_Id", id);
	return true;
	}
	#endregion
	}
}